package org.venus.onvif.controller;


import com.google.gson.Gson;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.venus.onvif.config.Config;
import org.venus.onvif.http.AjaxResult;

@RestController
@RequestMapping("/device")
@CrossOrigin
public class DeviceController {

    @GetMapping("selectCameraList")
    public AjaxResult selectCameraList() {
        /*String content = readFile(fileLocation);
        System.out.println(content);
        List<Video> videoList =
                JSON.parseObject(content, new TypeReference<List<Video>>() {
                });*/
        System.out.println("获取设备列表:" + new Gson().toJson(Config.videos));
        return AjaxResult.success(Config.videos);
    }

}
